![]() |
Kinetis SDK API Reference Manual
1.0.0-beta
Freescale Semiconductor, Inc.
|
The section describes the programming interface of the ENET HAL driver. More...
Data Structures | |
| struct | enet_bd_struct_t |
| Defines the buffer descriptor structure for the little-Endian system and endianness configurable IP. More... | |
| struct | enet_config_ptp_timer_t |
| Defines the configuration structure for the 1588 PTP timer. More... | |
| struct | enet_config_tx_accelerator_t |
| Defines the transmit accelerator configuration. More... | |
| struct | enet_config_rx_accelerator_t |
| Defines the receive accelerator configuration. More... | |
| struct | enet_config_tx_fifo_t |
| Defines the transmit FIFO configuration. More... | |
| struct | enet_config_rx_fifo_t |
| Defines the receive FIFO configuration. More... | |
Macros | |
| #define | SYSTEM_LITTLE_ENDIAN (1) |
| Defines the system endian type. More... | |
| #define | BSWAP_16(x) (uint16_t)((uint16_t)(((uint16_t)(x) & (uint16_t)0xFF00) >> 0x8) | (uint16_t)(((uint16_t)(x) & (uint16_t)0xFF) << 0x8)) |
| Define macro to do the endianness swap. | |
| #define | BSWAP_32(x) (uint32_t)((((uint32_t)(x) & 0x00FFU) << 24) | (((uint32_t)(x) & 0x00FF00U) << 8) | (((uint32_t)(x) & 0xFF0000U) >> 8) | (((uint32_t)(x) & 0xFF000000U) >> 24)) |
| #define | HTONS(n) (n) |
| #define | HTONL(n) (n) |
| #define | NTOHS(n) (n) |
| #define | NTOHL(n) (n) |
Typedefs | |
| typedef uint8_t | enetMacAddr [kEnetMacAddrLen] |
| Defines the six-byte Mac address type. More... | |
Functions | |
| static void | enet_hal_reset_ethernet (uint32_t instance) |
| Resets the ENET module. More... | |
| static bool | enet_hal_is_reset_completed (uint32_t instance) |
| Gets the ENET status to check whether the reset has completed. More... | |
| static void | enet_hal_enable_stop (uint32_t instance, bool isEnabled) |
| Enable or disable stop mode. More... | |
| static void | enet_hal_enable_sleep (uint32_t instance, bool isEnabled) |
| Enable or disable sleep mode. More... | |
| void | enet_hal_set_mac_address (uint32_t instance, enetMacAddr hwAddr) |
| Sets the Mac address. More... | |
| void | enet_hal_set_group_hashtable (uint32_t instance, uint32_t crcValue, enet_special_address_filter_t mode) |
| Sets the hardware addressing filtering to a multicast group address. More... | |
| void | enet_hal_set_individual_hashtable (uint32_t instance, uint32_t crcValue, enet_special_address_filter_t mode) |
| Sets the hardware addressing filtering to an individual address. More... | |
| static void | enet_hal_enable_payloadcheck (uint32_t instance, bool isEnabled) |
| Enable/disable payload length check. More... | |
| static void | enet_hal_enable_txcrcforward (uint32_t instance, bool isEnabled) |
| Enable/disable append CRC to transmitted frames. More... | |
| static void | enet_hal_enable_rxcrcforward (uint32_t instance, bool isEnabled) |
| Enable/disable forward the CRC filed of the received frame. More... | |
| static void | enet_hal_enable_pauseforward (uint32_t instance, bool isEnabled) |
| Enable/disable forward PAUSE frames. More... | |
| static void | enet_hal_enable_padremove (uint32_t instance, bool isEnabled) |
| Enable/disable frame padding remove on receive. More... | |
| static void | enet_hal_enable_flowcontrol (uint32_t instance, bool isEnabled) |
| Enable/disable flow control. More... | |
| static void | enet_hal_enable_broadcastreject (uint32_t instance, bool isEnabled) |
| Enable/disable broadcast frame reject. More... | |
| static void | enet_hal_set_pauseduration (uint32_t instance, uint32_t pauseDuration) |
| Sets PAUSE duration for a PAUSE frame. More... | |
| static bool | enet_hal_get_rxpause_status (uint32_t instance) |
| Gets receive PAUSE frame status. More... | |
| static void | enet_hal_enable_txpause (uint32_t instance, bool isEnabled) |
| Enables transmit frame control PAUSE. More... | |
| void | enet_hal_set_txpause (uint32_t instance, uint32_t pauseDuration) |
| Sets transmit PAUSE frame. More... | |
| static void | enet_hal_set_txipg (uint32_t instance, uint32_t ipgValue) |
| Sets the transmit inter-packet gap. More... | |
| static void | enet_hal_set_truncationlen (uint32_t instance, uint32_t length) |
| Sets the receive frame truncation length. More... | |
| static void | enet_hal_set_rx_max_size (uint32_t instance, uint32_t maxBufferSize, uint32_t maxFrameSize) |
| Sets the maximum receive buffer size and the maximum frame size. More... | |
| void | enet_hal_config_tx_fifo (uint32_t instance, enet_config_tx_fifo_t *thresholdCfg) |
| Configures the ENET transmit FIFO. More... | |
| void | enet_hal_config_rx_fifo (uint32_t instance, enet_config_rx_fifo_t *thresholdCfg) |
| Configures the ENET receive FIFO. More... | |
| static void | enet_hal_set_rxbd_address (uint32_t instance, uint32_t rxBdAddr) |
| Sets the start address for ENET receive buffer descriptors. More... | |
| static void | enet_hal_set_txbd_address (uint32_t instance, uint32_t txBdAddr) |
| Sets the start address for ENET transmit buffer descriptors. More... | |
| void | enet_hal_init_rxbds (void *rxBds, uint8_t *buffer, bool isLastBd) |
| Initializes the receive buffer descriptors. More... | |
| void | enet_hal_init_txbds (void *txBds, bool isLastBd) |
| Initializes the transmit buffer descriptors. More... | |
| void | enet_hal_update_rxbds (void *rxBds, uint8_t *data, bool isbufferUpdate) |
| Updates the receive buffer descriptors. More... | |
| void | enet_hal_update_txbds (void *txBds, uint8_t *buffer, uint16_t length, bool isTxtsCfged) |
| Updates the transmit buffer descriptors. More... | |
| static void | enet_hal_clear_txbds (void *curBd) |
| Clears the context in the transmit buffer descriptors. More... | |
| uint16_t | enet_hal_get_rxbd_control (void *curBd) |
| Gets the control and the status region of the receive buffer descriptors. More... | |
| uint16_t | enet_hal_get_txbd_control (void *curBd) |
| Gets the control and the status region of the transmit buffer descriptors. More... | |
| bool | enet_hal_get_rxbd_control_extend (void *curBd, enet_rx_bd_control_extend_t controlRegion) |
| Gets the extended control region of the receive buffer descriptors. More... | |
| uint16_t | enet_hal_get_txbd_control_extend (void *curBd) |
| Gets the extended control region of the transmit buffer descriptors. More... | |
| uint16_t | enet_hal_get_bd_length (void *curBd) |
| Gets the data length of the buffer descriptors. More... | |
| uint8_t * | enet_hal_get_bd_buffer (void *curBd) |
| Gets the buffer address of the buffer descriptors. More... | |
| uint32_t | enet_hal_get_bd_timestamp (void *curBd) |
| Gets the timestamp of the buffer descriptors. More... | |
| static void | enet_hal_active_rxbd (uint32_t instance) |
| Activates the receive buffer descriptor. More... | |
| static void | enet_hal_active_txbd (uint32_t instance) |
| Activates the transmit buffer descriptor. More... | |
| void | enet_hal_config_rmii (uint32_t instance, enet_config_rmii_t mode, enet_config_speed_t speed, enet_config_duplex_t duplex, bool isRxOnTxDisabled, bool isLoopEnabled) |
| Configures the (R)MII of ENET. More... | |
| static void | enet_hal_config_mii (uint32_t instance, uint32_t miiSpeed, enet_mdio_holdon_clkcycle_t clkCycle, bool isPreambleDisabled) |
| Configures the MII of ENET. More... | |
| static bool | enet_hal_is_mii_enabled (uint32_t instance) |
| Gets the MII configuration status. More... | |
| static uint32_t | enet_hal_get_mii_data (uint32_t instance) |
| Reads data from PHY. More... | |
| void | enet_hal_set_mii_command (uint32_t instance, uint32_t phyAddr, uint32_t phyReg, enet_mii_operation_t operation, uint32_t data) |
| Sets the MII command. More... | |
| void | enet_hal_config_ethernet (uint32_t instance, bool isEnhanced, bool isEnabled) |
| Enables/Disables the ENET module. More... | |
| void | enet_hal_config_interrupt (uint32_t instance, uint32_t source, bool isEnabled) |
| Enables/Disables the ENET interrupt. More... | |
| static void | enet_hal_clear_interrupt (uint32_t instance, uint32_t source) |
| Clears ENET interrupt events. More... | |
| static bool | enet_hal_get_interrupt_status (uint32_t instance, uint32_t source) |
| Gets the ENET interrupt status. More... | |
| static void | enet_hal_config_promiscuous (uint32_t instance, bool isEnabled) |
| static void | enet_hal_clear_mib (uint32_t instance, bool isEnabled) |
| Enables/disables the clear MIB counter. More... | |
| static void | enet_hal_enable_mib (uint32_t instance, bool isEnabled) |
| Sets the enable/disable of the MIB block. More... | |
| static bool | enet_hal_get_mib_status (uint32_t instance) |
| Gets the MIB idle status. More... | |
| void | enet_hal_config_tx_accelerator (uint32_t instance, enet_config_tx_accelerator_t *txCfgPtr) |
| Sets the transmit accelerator. More... | |
| void | enet_hal_config_rx_accelerator (uint32_t instance, enet_config_rx_accelerator_t *rxCfgPtr) |
| Sets the receive accelerator. More... | |
| void | enet_hal_init_ptp_timer (uint32_t instance, enet_config_ptp_timer_t *ptpCfgPtr) |
| Initializes the 1588 timer. More... | |
| static void | enet_hal_enable_ptp_timer (uint32_t instance, uint32_t isEnabled) |
| Enables or disables the 1588 timer. More... | |
| static void | enet_hal_restart_ptp_timer (uint32_t instance) |
| Restarts the 1588 timer. More... | |
| static void | enet_hal_adjust_ptp_timer (uint32_t instance, uint32_t increaseCorrection, uint32_t periodCorrection) |
| Adjusts the 1588 timer. More... | |
| static void | enet_hal_init_timer_channel (uint32_t instance, uint32_t channel, enet_timer_channel_mode_t mode) |
| Initializes the 1588 timer channel. More... | |
| static void | enet_hal_set_timer_channel_compare (uint32_t instance, uint32_t channel, uint32_t compareValue) |
| Sets the compare value for the 1588 timer channel. More... | |
| static bool | enet_hal_get_timer_channel_status (uint32_t instance, uint32_t channel) |
| Gets the 1588 timer channel status. More... | |
| static void | enet_hal_clear_timer_channel_flag (uint32_t instance, uint32_t channel) |
| Clears the 1588 timer channel flag. More... | |
| static void | enet_hal_set_timer_capture (uint32_t instance) |
| Sets the capture command to the 1588 timer. More... | |
| static void | enet_hal_set_current_time (uint32_t instance, uint32_t nanSecond) |
| Sets the 1588 timer. More... | |
| static uint32_t | enet_hal_get_current_time (uint32_t instance) |
| Gets the time from the 1588 timer. More... | |
| static uint32_t | enet_hal_get_tx_timestamp (uint32_t instance) |
| Gets the transmit timestamp. More... | |
| bool | enet_hal_get_txbd_timestamp_flag (void *curBd) |
| Gets the transmit buffer descriptor timestamp flag. More... | |
| static uint32_t | enet_hal_get_bd_size (void) |
| Gets the buffer descriptor timestamp. More... | |
| struct enet_bd_struct_t |
Data Fields | |
| uint16_t | length |
| Buffer descriptor data length. | |
| uint16_t | control |
| Buffer descriptor control. | |
| uint8_t * | buffer |
| Data buffer pointer. | |
| uint16_t | controlExtend0 |
| Extend buffer descriptor control0. | |
| uint16_t | controlExtend1 |
| Extend buffer descriptor control1. | |
| uint16_t | payloadCheckSum |
| Internal payload checksum. | |
| uint8_t | headerLength |
| Header length. | |
| uint8_t | protocalTyte |
| Protocol type. | |
| uint16_t | reserved0 |
| uint16_t | controlExtend2 |
| Extend buffer descriptor control2. | |
| uint32_t | timestamp |
| Timestamp. | |
| uint16_t | reserved1 |
| uint16_t | reserved2 |
| uint16_t | reserved3 |
| uint16_t | reserved4 |
| struct enet_config_ptp_timer_t |
Data Fields | |
| bool | isSlaveEnabled |
| Master or slave PTP timer. | |
| uint32_t | clockIncease |
| Timer increase value each clock period. | |
| uint32_t | period |
| Timer period for generate interrupt event. | |
| struct enet_config_tx_accelerator_t |
Data Fields | |
| bool | isIpCheckEnabled |
| Insert IP header checksum. | |
| bool | isProtocolCheckEnabled |
| Insert protocol checksum. | |
| bool | isShift16Enabled |
| Tx FIFO shift-16. | |
| struct enet_config_rx_accelerator_t |
Data Fields | |
| bool | isIpcheckEnabled |
| Discard with wrong IP header checksum. | |
| bool | isProtocolCheckEnabled |
| Discard with wrong protocol checksum. | |
| bool | isMacCheckEnabled |
| Discard with Mac layer errors. | |
| bool | isPadRemoveEnabled |
| Padding removal for short IP frames. | |
| bool | isShift16Enabled |
| Rx FIFO shift-16. | |
| struct enet_config_tx_fifo_t |
Data Fields | |
| bool | isStoreForwardEnabled |
| Transmit FIFO store and forward. | |
| uint8_t | txFifoWrite |
| Transmit FIFO write. | |
| uint8_t | txEmpty |
| Transmit FIFO section empty threshold. | |
| uint8_t | txAlmostEmpty |
| Transmit FIFO section almost empty threshold. | |
| uint8_t | txAlmostFull |
| Transmit FIFO section almost full threshold. | |
| struct enet_config_rx_fifo_t |
Data Fields | |
| uint8_t | rxFull |
| Receive FIFO section full threshold. | |
| uint8_t | rxAlmostFull |
| Receive FIFO section almost full threshold. | |
| uint8_t | rxEmpty |
| Receive FIFO section empty threshold. | |
| uint8_t | rxAlmostEmpty |
| Receive FIFO section almost empty threshold. | |
| #define SYSTEM_LITTLE_ENDIAN (1) |
| typedef uint8_t enetMacAddr[kEnetMacAddrLen] |
| enum enet_status_t |
| enum enet_config_rmii_t |
| enum enet_config_speed_t |
| enum enet_config_duplex_t |
| enum enet_mii_operation_t |
|
inlinestatic |
| instance | The ENET instance number |
|
inlinestatic |
| instance | The ENET instance number |
|
inlinestatic |
Enable stop mode will control device behavior in doze mode. In doze mode, if this filed is set then all clock of the enet assemably are disabled, except the RMII/MII clock.
| instance | The ENET instance number. |
| isEnabled | The switch to enable/disable stop mode.
|
|
inlinestatic |
Enable sleep mode will disable normal operating mode. When enable the sleep mode, the magic packet detection is also enabled so that a remote agent can wakeup the node.
| instance | The ENET instance number. |
| isEnabled | The switch to enable/disable the sleep mode.
|
| void enet_hal_set_mac_address | ( | uint32_t | instance, |
| enetMacAddr | hwAddr | ||
| ) |
This interface sets the six-byte Mac address of the ENET interface.
| instance | The ENET instance number |
| hwAddr | The mac address pointer store for six bytes Mac address |
| void enet_hal_set_group_hashtable | ( | uint32_t | instance, |
| uint32_t | crcValue, | ||
| enet_special_address_filter_t | mode | ||
| ) |
This interface is used to add the ENET device to a multicast group address. After joining the group, Mac receives all frames with the group Mac address.
| instance | The ENET instance number |
| crcValue | The CRC value of the special address |
| mode | The operation for init/enable/disable the specified hardware address |
| void enet_hal_set_individual_hashtable | ( | uint32_t | instance, |
| uint32_t | crcValue, | ||
| enet_special_address_filter_t | mode | ||
| ) |
This interface is used to add an individual address to the hardware address filter. Mac receives all frames with the individual address as a destination address.
| instance | The ENET instance number |
| crcValue | The CRC value of the special address |
| mode | The operation for init/enable/disable the specified hardware address |
|
inlinestatic |
If the length/type is less than 0x600,When enable payload length check the core checks the fame's payload length. If the length/type is greater than or equal to 0x600. The MAC interprets the field as a type and no payload length check is performanced.
| instance | The ENET instance number |
| isEnabled | The switch to enable/disable payload length check
|
|
inlinestatic |
If transmit CRC forward is enabled, the transmit buffer descriptor controls whether the frame has a CRC from the application. If transmit CRC forward is disabled, transmitter does not append any CRC to transmitted frames.
| instance | The ENET instance number |
| isEnabled | The switch to enable/disable transmit the receive CRC
|
|
inlinestatic |
This is used to deceide whether the CRC field of received frame is transmitted or stripped. Enable this feature to strip CRC field from the frame. If padding remove is enabled, this feature will be ignored and the CRC field is checked and always terminated and removed.
| instance | The ENET instance number |
| isEnabled | The switch to enable/disable transmit the receive CRC
|
|
inlinestatic |
This is used to deceide whether PAUSE frames is forwarded or discarded.
| instance | The ENET instance number |
| isEnabled | The switch to enable/disable forward PAUSE frames
|
|
inlinestatic |
Enable frame padding remove will remove the padding from the received frames.
| instance | The ENET instance number |
| isEnabled | The switch to enable/disable remove padding
|
|
inlinestatic |
If flow control is enabled, the receive detects PAUSE frames. Upon PAUSE frame detection, the transmitter stops transmitting data frames for a given duration.
| instance | The ENET instance number |
| isEnabled | The switch to enable/disable flow control
|
|
inlinestatic |
If broadcast frame reject is enabled, frames with destination address equal to 0xffff_ffff_ffff are rejected unless the promiscuous mode is open.
| instance | The ENET instance number |
| isEnabled | The switch to enable/disable reject broadcast frames
|
|
inlinestatic |
This function is used to set the pause duraion used in transmission of a PAUSE frame. When another node detects a PAUSE frame, that node pauses transmission for the pause duration.
| instance | The ENET instance number |
| pauseDuration | The PAUSE duration for the transmitted PAUSE frame the maximum pause duration is 0xFFFF. |
|
inlinestatic |
This function is used to get the received PAUSE frame status.
| instance | The ENET instance number |
|
inlinestatic |
This function enables pauses frame transmission. When this is set, with transmission of data frames stopped, the MAC transmits a MAC control PAUSE frame. NEXT, the MAC clear the and resumes transmitting data frames.
| instance | The ENET instance number |
| isEnabled | The switch to enable/disable PAUSE control frame transmission
|
| void enet_hal_set_txpause | ( | uint32_t | instance, |
| uint32_t | pauseDuration | ||
| ) |
This function Sets ENET transmit controller with pause duration. And set the transmit control to do PAUSE frame transmission This should be called when a PAUSE frame is dynamically wanted.
| instance | The ENET instance number |
|
inlinestatic |
This function indicates the IPG, in bytes, between transmitted frames. Valid values range from 8 to 27. If value is less than 8, the IPG is 8. If value is greater than 27, the IPG is 27.
| instance | The ENET instance number |
| ipgValue | The IPG for transmitted frames The default value is 12, the maximum value set to ipg is 0x1F. |
|
inlinestatic |
This function indicates the value a receive frame is truncated, if it is greater than this value. The frame truncation length must be greater than or equal to the receive maximum frame length.
| instance | The ENET instance number |
| length | The truncation length. The maximum value is 0x3FFF The default truncation length is 2047(0x7FF). |
|
inlinestatic |
| instance | The ENET instance number |
| maxBufferSize | The maximum receive buffer size, which should not be smaller than 256 It should be evenly divisible by 16 and the maximum receive size should not be larger than 0x3ff0. |
| maxFrameSize | The maximum receive frame size, the reset value is 1518 or 1522 if the VLAN tags are supported. The length is measured starting at DA and including the CRC. |
| void enet_hal_config_tx_fifo | ( | uint32_t | instance, |
| enet_config_tx_fifo_t * | thresholdCfg | ||
| ) |
| instance | The ENET instance number |
| thresholdCfg | The FIFO threshold configuration |
| void enet_hal_config_rx_fifo | ( | uint32_t | instance, |
| enet_config_rx_fifo_t * | thresholdCfg | ||
| ) |
| instance | The ENET instance number |
| thresholdCfg | The FIFO threshold configuration |
|
inlinestatic |
This interface provides the beginning of the receive and receive buffer descriptor queue in the external memory. The txbdAddr is recommended to be 128-bit aligned, must be evenly divisible by 16.
| instance | The ENET instance number |
| rxBdAddr | The start address of receive buffer descriptors |
|
inlinestatic |
This interface provides the beginning of the receive and transmit buffer descriptor queue in the external memory. The txbdAddr is recommended to be 128-bit aligned, must be evenly divisible by 16.
| instance | The ENET instance number |
| txBdAddr | The start address of transmit buffer descriptors |
| void enet_hal_init_rxbds | ( | void * | rxBds, |
| uint8_t * | buffer, | ||
| bool | isLastBd | ||
| ) |
To make sure the uDMA will do the right data transfer after you activate with wrap flag and all the buffer descriptors should be initialized with an empty bit.
| rxBds | The current receive buffer descriptor |
| buffer | The data buffer on buffer descriptor |
| isLastBd | The flag to indicate the last receive buffer descriptor |
| void enet_hal_init_txbds | ( | void * | txBds, |
| bool | isLastBd | ||
| ) |
To make sure the uDMA will do the right data transfer after you active with wrap flag.
| txBds | The current transmit buffer descriptor. |
| isLastBd | The last transmit buffer descriptor flag. |
Ensures that the uDMA transfer data correctly after the user activates with the wrap flag.
| txBds | The current transmit buffer descriptor |
| isLastBd | The last transmit buffer descriptor flag |
| void enet_hal_update_rxbds | ( | void * | rxBds, |
| uint8_t * | data, | ||
| bool | isbufferUpdate | ||
| ) |
This interface mainly clears the status region and updates the received buffer descriptor to ensure that the BD is correctly used.
| rxBds | The current receive buffer descriptor |
| data | The data buffer address |
| isbufferUpdate | The data buffer update flag. When you want to update the data buffer of the buffer descriptor ensure that this flag is set. |
| void enet_hal_update_txbds | ( | void * | txBds, |
| uint8_t * | buffer, | ||
| uint16_t | length, | ||
| bool | isTxtsCfged | ||
| ) |
This interface mainly clears the status region and updates the transmit buffer descriptor to ensure tat this BD is correctly used again. You should set the isTxtsCfged when the transmit timestamp feature is required.
| txBds | The current transmit buffer descriptor |
| buffer | The data buffer on buffer descriptor |
| length | The data length on buffer descriptor |
| isTxtsCfged | The timestamp configure flag. The timestamp is added to the transmit buffer descriptor when this flag is set. |
|
inlinestatic |
Clears the data, length, control, and status region of the transmit buffer descriptor.
| curBd | The current buffer descriptor |
| uint16_t enet_hal_get_rxbd_control | ( | void * | curBd | ) |
This interface can get the whole control and status region of the receive buffer descriptor. The enet_rx_bd_control_status_t enum type definition should be used if you want to get each status bit of the control and status region.
| curBd | The current receive buffer descriptor |
| uint16_t enet_hal_get_txbd_control | ( | void * | curBd | ) |
This interface can get the whole control and status region of the transmit buffer descriptor. The enet_tx_bd_control_status_t enum type definition should be used if you want to get each status bit of the control and status region.
| curBd | The current transmit buffer descriptor |
| bool enet_hal_get_rxbd_control_extend | ( | void * | curBd, |
| enet_rx_bd_control_extend_t | controlRegion | ||
| ) |
This interface can get the whole control and status region of the receive buffer descriptor. The enet_rx_bd_control_extend_t enum type definition should be used if you want to get each status bit of the control and status region.
| curBd | The current receive buffer descriptor |
| controlRegion | The different control region |
| uint16_t enet_hal_get_txbd_control_extend | ( | void * | curBd | ) |
This interface can get the whole control and status region of the transmit buffer descriptor. The enet_tx_bd_control_extend_t enum type definition should be used if you want to get each status bit of the control and status region.
| curBd | The current transmit buffer descriptor |
| uint16_t enet_hal_get_bd_length | ( | void * | curBd | ) |
| curBd | The current buffer descriptor |
| uint8_t* enet_hal_get_bd_buffer | ( | void * | curBd | ) |
| curBd | The current buffer descriptor |
| uint32_t enet_hal_get_bd_timestamp | ( | void * | curBd | ) |
| curBd | The current buffer descriptor |
|
inlinestatic |
The buffer descriptor activation should be done after the ENET module is enabled. Otherwise, the activation fails.
| instance | The ENET instance number |
|
inlinestatic |
The buffer descriptor activation should be done after the ENET module is enabled. Otherwise, the activation fails.
| instance | The ENET instance number |
| void enet_hal_config_rmii | ( | uint32_t | instance, |
| enet_config_rmii_t | mode, | ||
| enet_config_speed_t | speed, | ||
| enet_config_duplex_t | duplex, | ||
| bool | isRxOnTxDisabled, | ||
| bool | isLoopEnabled | ||
| ) |
| instance | The ENET instance number |
| mode | The RMII or MII mode |
| speed | The speed of RMII |
| duplex | The full or half duplex mode |
| isRxOnTxDisabled | The Receive on transmit disable flag |
| isLoopEnabled | The loop enable flag |
|
inlinestatic |
Sets the MII interface between Mac and PHY. The miiSpeed is a value that controls the frequency of the MDC, relative to the internal module clock(InterClockSrc). A value of zero in this parameter turns the MDC off and leaves it in the low voltage state. Any non-zero value results in the MDC frequency MDC = InterClockSrc/((miiSpeed + 1)*2). So miiSpeed = InterClockSrc/(2*MDC) - 1. The Maximum MDC clock is 2.5MHZ(maximum). We should round up and plus one to simlplify: miiSpeed = InterClockSrc/(2*2.5MHZ).
| instance | The ENET instance number |
| miiSpeed | The MII speed and it is ranged from 0~0x3F |
| time | The holdon clock cycles for MDIO output |
| isPreambleDisabled | The preamble disabled flag |
|
inlinestatic |
This interface is usually called to check the MII interface before the Mac writes or reads the PHY registers.
| instance | The ENET instance number |
|
inlinestatic |
| instance | The ENET instance number |
| void enet_hal_set_mii_command | ( | uint32_t | instance, |
| uint32_t | phyAddr, | ||
| uint32_t | phyReg, | ||
| enet_mii_operation_t | operation, | ||
| uint32_t | data | ||
| ) |
| instance | The ENET instance number |
| phyAddr | The PHY address |
| phyReg | The PHY register |
| operation | The read or write operation |
| data | The data written to PHY |
| void enet_hal_config_ethernet | ( | uint32_t | instance, |
| bool | isEnhanced, | ||
| bool | isEnabled | ||
| ) |
| instance | The ENET instance number |
| isEnhanced | The enhanced 1588 feature switch |
| isEnabled | The ENET module enable switch |
| void enet_hal_config_interrupt | ( | uint32_t | instance, |
| uint32_t | source, | ||
| bool | isEnabled | ||
| ) |
| instance | The ENET instance number |
| source | The interrupt sources. enet_interrupt_request_t enum types is recommended as the interrupt source. |
| isEnabled | The interrupt enable switch |
|
inlinestatic |
| instance | The ENET instance number |
| source | The interrupt source to be cleared. enet_interrupt_request_t enum types is recommended as the interrupt source. |
|
inlinestatic |
| instance | The ENET instance number |
| source | The interrupt sources. enet_interrupt_request_t enum types is recommended as the interrupt source. |
|
inlinestatic |
| instance | The ENET instance number |
| isEnabled | The enable switch |
|
inlinestatic |
| instance | The ENET instance number |
| isEnabled | The enable flag
|
|
inlinestatic |
| instance | The ENET instance number |
| void enet_hal_config_tx_accelerator | ( | uint32_t | instance, |
| enet_config_tx_accelerator_t * | txCfgPtr | ||
| ) |
| instance | The ENET instance number |
| txCfgPtr | The transmit accelerator configuration |
| void enet_hal_config_rx_accelerator | ( | uint32_t | instance, |
| enet_config_rx_accelerator_t * | rxCfgPtr | ||
| ) |
| instance | The ENET instance number |
| rxCfgPtr | The receive accelerator configuration |
| void enet_hal_init_ptp_timer | ( | uint32_t | instance, |
| enet_config_ptp_timer_t * | ptpCfgPtr | ||
| ) |
This interface initializes the 1588 context structure. Initialize 1588 parameters according to the user configuration structure.
| instance | The ENET instance number |
| ptpCfg | The 1588 timer configuration |
|
inlinestatic |
Enable the PTP timer will starts the timer. Disable the timer will stop timer at the current value.
| instance | The ENET instance number. |
| isEnabled | The 1588 timer Enable switch
|
|
inlinestatic |
Restarting the PTP timer clears all PTP-timer counters to zero.
| instance | The ENET instance number |
|
inlinestatic |
Adjust the 1588 timer according to the increase and correction period of the configured correction.
| instance | The ENET instance number |
| inceaseCorrection | The increase correction for 1588 timer |
| periodCorrection | The period correction for 1588 timer |
|
inlinestatic |
| instance | The ENET instance number channel The 1588 timer channel number |
| mode | Compare or capture mode for the 1588 timer channel |
|
inlinestatic |
| instance | The ENET instance number channel The 1588 timer channel number |
| compareValue | Compare value for 1588 timer channel |
|
inlinestatic |
| instance | The ENET instance number |
| channel | The 1588 timer channel number |
|
inlinestatic |
| instance | The ENET instance number |
| channel | The 1588 timer channel number |
|
inlinestatic |
This is used before reading the current time register. After set timer capture, please wait for about 1us before read the captured timer.
| instance | The ENET instance number |
|
inlinestatic |
| instance | The ENET instance number |
| nanSecond | The nanosecond set to 1588 timer |
|
inlinestatic |
| instance | The ENET instance number |
|
inlinestatic |
| instance | The ENET instance number |
| bool enet_hal_get_txbd_timestamp_flag | ( | void * | curBd | ) |
| curBd | The ENET transmit buffer descriptor |
|
inlinestatic |
| null |